(global.webpackJsonp = global.webpackJsonp || []).push([ [ "pages/components/login-btn/index" ], {
    "27af": function(e, t, n) {
        n.r(t);
        var o = n("ede7"), r = n.n(o);
        for (var a in o) [ "default" ].indexOf(a) < 0 && function(e) {
            n.d(t, e, function() {
                return o[e];
            });
        }(a);
        t.default = r.a;
    },
    "445c": function(e, t, n) {
        n.d(t, "b", function() {
            return o;
        }), n.d(t, "c", function() {
            return r;
        }), n.d(t, "a", function() {});
        var o = function() {
            this.$createElement;
            this._self._c;
        }, r = [];
    },
    "87b0": function(e, t, n) {
        n.r(t);
        var o = n("445c"), r = n("27af");
        for (var a in r) [ "default" ].indexOf(a) < 0 && function(e) {
            n.d(t, e, function() {
                return r[e];
            });
        }(a);
        n("97d3");
        var c = n("f0c5"), i = Object(c.a)(r.default, o.b, o.c, !1, null, "07b6f63a", null, !1, o.a, void 0);
        t.default = i.exports;
    },
    ede7: function(e, t, n) {
        (function(e) {
            var o = n("4ea4");
            Object.defineProperty(t, "__esModule", {
                value: !0
            }), t.default = void 0;
            var r = o(n("2eee")), a = o(n("c973")), c = o(n("9523")), i = n("26cb");
            function s(e, t) {
                var n = Object.keys(e);
                if (Object.getOwnPropertySymbols) {
                    var o = Object.getOwnPropertySymbols(e);
                    t && (o = o.filter(function(t) {
                        return Object.getOwnPropertyDescriptor(e, t).enumerable;
                    })), n.push.apply(n, o);
                }
                return n;
            }
            function f(e) {
                for (var t = 1; t < arguments.length; t++) {
                    var n = null != arguments[t] ? arguments[t] : {};
                    t % 2 ? s(Object(n), !0).forEach(function(t) {
                        (0, c.default)(e, t, n[t]);
                    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : s(Object(n)).forEach(function(t) {
                        Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
                    });
                }
                return e;
            }
            t.default = {
                name: "LoginButton",
                props: {
                    text: {
                        type: String,
                        default: ""
                    }
                },
                computed: f({}, (0, i.mapState)({
                    canIUseGetUserProfile: function(e) {
                        return e.user.canIUseGetUserProfile;
                    }
                })),
                methods: f(f(f({}, (0, i.mapMutations)([ "commonUpdate", "setHasUserInfo" ])), (0, 
                i.mapActions)([ "updateUserInfo" ])), {}, {
                    handleGetUserProfile: function() {
                        var t = this;
                        this._doLog("新版用户信息接口"), this.canIUseGetUserProfile && (this.btnLock || (this.btnLock = !0, 
                        e.getUserProfile({
                            desc: "用于完善用户信息资料",
                            success: function(e) {
                                t.handleUserInfo(e.userInfo);
                            },
                            fail: function(e) {
                                t._doLog(e), t.btnLock = !1;
                            }
                        })));
                    },
                    handleGetUserInfo: function(t) {
                        if (!this.canIUseGetUserProfile && (this._doLog("旧版用户信息接口"), !this.btnLock)) {
                            this.btnLock = !0;
                            var n = t.detail, o = n.errMsg, r = n.userInfo;
                            "getUserInfo:ok" === o ? this.handleUserInfo(r) : "getUserInfo:fail auth deny" === o ? (e.showModal({
                                title: "用户未授权",
                                content: '如果需要正常使用此小程序功能，请按确定并在授权管理中打开"用户信息"。最后再进入小程序即可正常使用。',
                                showCancel: !1,
                                success: function() {
                                    e.openSetting();
                                }
                            }), this.btnLock = !1) : (this._doLog("用户信息获取失败", o), this.btnLock = !1);
                        }
                    },
                    handleUserInfo: function(t) {
                        var n = this;
                        return (0, a.default)(r.default.mark(function o() {
                            return r.default.wrap(function(o) {
                                for (;;) switch (o.prev = o.next) {
                                  case 0:
                                    e.showLoading({
                                        title: "登录中",
                                        mask: !0
                                    });
                                    try {
                                        n.loginWX(function() {
                                            n.commonUpdate({
                                                module: "user",
                                                type: "info",
                                                value: f(f(f({}, t), n.user), {}, {
                                                    nickname: t.nickName,
                                                    avatar: t.avatarUrl
                                                })
                                            }), n.updateUserInfo({
                                                open_id: n.user.open_id,
                                                nickname: t.nickName,
                                                avatar: t.avatarUrl
                                            }), n.setHasUserInfo(!0), e.hideLoading(), n.btnLock = !1;
                                        }, !0), n.$emit("getUserCallback");
                                    } catch (t) {
                                        t = VM2_INTERNAL_STATE_DO_NOT_USE_OR_PROGRAM_WILL_FAIL.handleException(t);
                                        n.btnLock = !1, e.hideLoading(), console.error("用户信息更新失败", t);
                                    }

                                  case 2:
                                  case "end":
                                    return o.stop();
                                }
                            }, o);
                        }))();
                    },
                    _doLog: function() {
                        var e;
                        (e = console).log.apply(e, [ "byLog:" ].concat(Array.prototype.slice.call(arguments)));
                    }
                })
            };
        }).call(this, n("543d").default);
    }
} ]), (global.webpackJsonp = global.webpackJsonp || []).push([ "pages/components/login-btn/index-create-component", {
    "pages/components/login-btn/index-create-component": function(e, t, n) {
        n("543d").createComponent(n("87b0"));
    }
}, [ [ "pages/components/login-btn/index-create-component" ] ] ]);